<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>1.基本列表渲染</title>
        <!-- 引入Vue -->
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 准备好一个容器-->
        <div id="demo">
            <h1>人员列表</h1>
            <ul>
                <!-- key最好用唯一标识符 -->
                <li v-for='(p,index) in persons' :key='p.id'>
                    {{index}}--{{p.name}}--{{p.age}}
                </li>
            </ul>
        </div>
    </body>

    <script type="text/javascript">
        //阻止 vue 在启动时生成生产提示。
        Vue.config.productionTip = false
        new Vue({
			el:'#demo',
			data:{
				persons:[
					{id:'001',name:'张三',age:18},
					{id:'002',name:'李四',age:19},
					{id:'003',name:'王五',age:20},
				]
			}
		})
    </script>
</html>